package com.example.myworkers.service.imp;


import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.myworkers.dao.EmpBreakMapper;
import com.example.myworkers.model.EmpBreak;
import com.example.myworkers.service.EmpBreakService;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author 吴秋霞
 * @description 针对表【emp_break】的数据库操作Service实现
 * @createDate 2023-10-29 17:05:13
 */
@Service public class EmpBreakServiceImpl extends ServiceImpl<EmpBreakMapper, EmpBreak>
        implements EmpBreakService {

    @Override
    public List<EmpBreak> getEmpBreakList(EmpBreak empBreak) {

        LambdaQueryWrapper<EmpBreak> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(empBreak.getEmpname() != null,EmpBreak::getEmpname,empBreak.getEmpname())
                .eq(StringUtils.isNotBlank(empBreak.getBreakstarttime()),EmpBreak::getBreakstarttime,empBreak.getBreakstarttime())
                .eq(StringUtils.isNotBlank(empBreak.getBreaktype()),EmpBreak::getBreaktype,empBreak.getBreaktype())
                .eq(StringUtils.isNotBlank(empBreak.getBreakstate()),EmpBreak::getBreakstate,empBreak.getBreakstate());

        List<EmpBreak> list = list(queryWrapper);
        return list;
    }
}


